﻿var page = new lg.page({
    data: {
        classId: 0,
        classSelect: null
    },
    mounted: function () {
        this.List();
    },
    methods: {
        List: function () {
            layui.use(['form', 'table', 'upload'], function () {
                var table = layui.table;
                var form = layui.form;
                page.laytable = table.render({
                    elem: '#SysLogs'
                    , url: '/SysApi/GetSysLogs'
                    , cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                    , cols: [[
                        {
                            field: '', title: '#', width: 60, templet: function (d) {
                                return d.LAY_TABLE_INDEX + 1
                            }
                        }
                        , { field: 'Detail', title: '详情'}
                        , {
                            field: 'Time', title: '日期', width: 120
                        }
                        , { fixed: 'right', title: '操作', toolbar: '#btTpl', width: 100 }
                    ]],
                });
                //监听行工具事件
                table.on('tool(ArticleList)', function (obj) {
                    var data = obj.data;
                    //console.log(obj)
                    switch (obj.event) {
                        case 'info':
                            
                            break;
                        
                    }

                });
                form.on('submit(bt_Search)', function (data) {
                    page.laytable.reload({
                        where: data.field,
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                    });
                    return false;
                });
                
            });
        }
    }
});